Skip to content

Update library heuristics as short term solution for missing metadata. #1293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2021

Conversation

annagrin
Copy link
Contributor

  • Return first org-dartlang library as vmservice.rootLib
    (or main if not found)
  • Manually add dart_sdk module metadata in MetadataProvider.
  • Update and add tests.

Helps: dart-lang/sdk#44760
Helps: #1226

- Return first `org-dartlang` library as `vmservice.rootLib`
  (or `main` if not found)
- Manually add dart_sdk module metadata in `MetadataProvider`.
- Update and add tests.

Helps: dart-lang/sdk#44760
Helps: dart-lang#1226
@google-cla google-cla bot added the cla: yes label Mar 29, 2021
@annagrin annagrin requested a review from grouma March 29, 2021 22:24
return lib.name.contains('org-dartlang');
});
return _rootLib ??= _rootLib = libraries.firstWhere((lib) {
return lib.name.contains('main');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can fail if not found. Should we default to the last lib in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last lib is just random, whatever was read last from the metadata. Maybe we should just throw?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will set it to the last one for now, since throwing here would make initialize fail.

@annagrin annagrin merged commit fe9aeac into dart-lang:master Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants